package zy1220.zy2;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;

public class demo {
    public static void main(String[] args) throws IOException {
        File file = new File("D:\\ideadashuju12\\liu_ya_kai\\src\\zy1220\\zy2\\题7分析.jpg");
        byte[] arr = FileUtils.readFileToByteArray(file);
        for (byte b : arr) {
            if (arr.length<2*1000*1024&&(file+"").endsWith(".jpg")){
                System.out.println("上传成功");
            }
            break;
        }
    }
}
